package com.DFB.controller;

import com.DFB.common.model.Result;
import com.DFB.pojo.Head;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/test")
@ResponseBody
@CrossOrigin(origins = "http://localhost:5173")
public class textController {

    @GetMapping("/hello")
    public Result gethelloworld(){
        return new Result<>(200,"ok","hellowrold!");
    }

    @GetMapping("/headList")
    public Result getHeadList(){
        List<Object> list = new ArrayList<>();
        list.add(new Head("1","首页"));
        list.add(new Head("2","外卖"));
        list.add(new Head("3","店内"));
        list.add(new Head("4","商品"));
        list.add(new Head("5","用户"));
        list.add(new Head("6","财务"));
        list.add(new Head("7","装修"));
        list.add(new Head("8","门店"));
        list.add(new Head("9","数据"));
        list.add(new Head("9","数据"));
        list.add(new Head("9","应用"));
        list.add(new Head("9","设置"));
        list.add(new Head("9","员工"));

        return Result.success(list);
    }

}
